package chapter6;

/**
 * 面向接口编程，使用接口的多态模拟实现一个简单的工厂，从而把实现和接口分离，进行解耦
 */
public class PrintFactory {
    public Print getPrinter() {
        return new BlackAndWhitePrint();
    }

    public static void main(String[] args) {
        PrintFactory factory = new PrintFactory();
        Print printer = factory.getPrinter();
        printer.print();
    }
}
